login_flag = False

#登录功能装饰器
def login_verify(fn):
    def inner(*args, **kwargs):
            global login_flag
            if login_flag==False:
                print("请完成登录校验")
                while 1:
                    username= input("》》》》")
                    password= input("》》》》")
                    if  username =="admin" and password == "123":
                        login_flag=True
                        print("登录成功")
                        break
                    else:
                        print("登录失败，用户名或者密码错误")
            ret = fn(*args, **kwargs)
            return ret
    return inner

@login_verify
def add():
    print("进行添加操作")



@login_verify
def delete():
    print("进行删除操作")

@login_verify
def update():
    print("进行修改操作")

@login_verify
def search():
    print("进行查询操作")


add()
delete()
update()
search()
